﻿using System;
using System.ComponentModel.DataAnnotations;

namespace ERP.ERPSystem.ProductionSystem.Dto
{
    /// <summary>
    /// 过程检验DTO
    /// </summary>
    public class ProcessDTO
    {
        public int Id { get; set; }

        /// <summary>
        /// 检验单编号
        /// </summary>
        [Required(ErrorMessage = "检验单编号不能为空")]
        public string ProcessCode { get; set; }

        /// <summary>
        /// 检验类型
        /// </summary>
        [Required(ErrorMessage = "检验类型不能为空")]
        public string ProcessType { get; set; }

        /// <summary>
        /// 工单编号
        /// </summary>
        [Required(ErrorMessage = "工单编号不能为空")]
        public string OrderCode { get; set; }

        /// <summary>
        /// 产品物料编码
        /// </summary>
        [Required(ErrorMessage = "产品物料编码不能为空")]
        public string ProductCode { get; set; }

        /// <summary>
        /// 产品物料名称
        /// </summary>
        [Required(ErrorMessage = "产品物料名称不能为空")]
        public string ProductName { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specifications { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Unitt { get; set; }

        /// <summary>
        /// 检测数量
        /// </summary>
        [Required(ErrorMessage = "检测数量不能为空")]
        [Range(1, int.MaxValue, ErrorMessage = "检测数量必须大于0")]
        public int TestingNum { get; set; }

        /// <summary>
        /// 检测结果
        /// </summary>
        public string TestingResult { get; set; }

        /// <summary>
        /// 检测日期
        /// </summary>
        [Required(ErrorMessage = "检测日期不能为空")]
        public DateTime TestingDate { get; set; } = DateTime.Now;

        /// <summary>
        /// 检测人员
        /// </summary>
        [Required(ErrorMessage = "检测人员不能为空")]
        public string TestingPerson { get; set; }

        /// <summary>
        /// 单据状态
        /// </summary>
        public int State { get; set; } = 0;
    }
}